<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

/**
 * Description of MY_Encrypt
 *
 * @author Nazmul
 */
class MY_Encrypt extends CI_Encrypt {

    public function __construct() {
        parent::__construct();
    }

    function encode($string, $key = "", $url_safe = TRUE) {
        $ret = parent::encode($string, $key);
        if ($url_safe) {
            $ret = strtr($ret, array(
                '+' => '.',
                '=' => '-',
                '/' => '~'
            ));
        }
        return $ret;
    }

    function decode($string, $key = "") {
        $string = strtr($string, array(
            '.' => '+',
            '-' => '=',
            '~' => '/'
        ));
        return parent::decode($string, $key);
    }

}